package com.cloud.drore.eboss.login.token;

import com.alibaba.fastjson.annotation.JSONField;
import com.cloud.drore.eboss.login.feign.EbossRoleRightRelation;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2018<br>
 *
 * @Description: <br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/3/26 9:23 <br>
 * @Author: <a href="836327318@qq.com">吴昌益</a>
 */
@Data
public class TokenModel {
    //用户id
    @JsonProperty("user_id")
    @JSONField(name = "user_id")
    @ApiModelProperty(name = "user_id", notes = "头像", example = "1")
    private long userId;

    //随机生成的uuid
    private String token;

    @JsonProperty("show_imge")
    @JSONField(name = "show_imge")
    @ApiModelProperty(name = "show_imge", notes = "头像", example = "1")
    private String showImge;

    @NotNull
    @ApiModelProperty(name = "shiro_role_right_relation", notes = "关系实体")
    private List<EbossRoleRightRelation> ebossRoleRightRelation;

    public TokenModel(long userId, String token) {
        this.userId = userId;
        this.token = token;
    }

    @JsonProperty("is_admin")
    @JSONField(name = "is_admin")
    private Integer isAdmin;

    @JsonProperty("merchant_name")
    @JSONField(name = "merchant_name")
    @ApiModelProperty(name = "merchant_name", notes = "商户名称", example = "西溪湿地")
    private String merchantName;
    
}
